#include "ogl/gut/UniformBuffer.h"
#include "ogl/gut/Dictionary.h"
#include "imgui/Editor.h"

using namespace Ogl::Gut;

template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::UniformBuffer::Desc &inst)
{
    EditInst<unsigned int>("Data Size", inst.dataSize);

    return false;
};

template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::UniformBuffer &inst)
{
    int index = 0;

    if (TreeNode(label.c_str(), inst.m_BitFlag, index++))
    {

        if (TreeNode(label.c_str(), inst.m_BitFlag, index++))
        {
            EditInst<Ogl::Gut::UniformBuffer::Desc>("Desc", inst.m_Desc);
            ImGui::TreePop();
        }
        if (TreeNode("Buffer", inst.m_BitFlag, index++))
        {
            EditInst<Buffer>("buffer", inst);
            ImGui::TreePop();
        }
        ImGui::TreePop();
    }

    return false;
}
